
#ifndef __FOC_PORT_H
#define __FOC_PORT_H


#include <tim.h>

#include <stdint.h>
#include "foc_type.h"



/*PWM接口*/
#define U_H_SET_PWM(x)       (htim1.Instance->CCR3 =x)
#define V_H_SET_PWM(x)       (htim1.Instance->CCR2 =x)
#define W_H_SET_PWM(x)       (htim1.Instance->CCR1 =x)
#define U_L_SET_PWM(x)       (x)
#define V_L_SET_PWM(x)       (x)
#define W_L_SET_PWM(x)       (x)

/*霍尔接口*/
#define HALL_U_GET             HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_6)
#define HALL_V_GET             HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_7)
#define HALL_W_GET             HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_0)

/*电机使能*/
#define MOTOR_ENABLE         
#define MOTOR_DISENABLE        




void FOC_Port_Start(void);
void FOC_Port_Stop(void);

void FOC_Port_Pwm_Start(void);
void FOC_Port_Pwm_Stop(void);









#endif
